package com.qiaofang.service.impl;

import com.qiaofang.constant.OperationTargetEnum;
import com.qiaofang.entity.OperationLog;
import com.qiaofang.repository.OperationLogRepository;
import com.qiaofang.service.OperationLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OperationLogServiceImpl implements OperationLogService {

    @Autowired
    private OperationLogRepository operationLogRepository;

    @Override
    public void addOperationLog(String opt, Long id) {
        //操作日志
        OperationLog operationLog = new OperationLog();
        operationLog.setOptType(opt);
        operationLog.setOptTargetId(id);
        operationLog.setOptTarget(OperationTargetEnum.TYPE_1.getNo());
        operationLogRepository.save(operationLog);
    }
}
